#include "factory.h"
#include <iostream>

using namespace factory;

void Pizza::prepare()
{
   std::cout << "Preparing " << this->m_name << std::endl;
   std::cout << "Tossing dough..." << std::endl;
   std::cout << "Adding sauce..." << std::endl;
   std::cout << "Adding toppings:" << std::endl;

   std::vector<std::string>::iterator it = this->m_toppings.begin();
   for(; it != this->m_toppings.end(); ++it)
   {
       std::cout << *it << std::endl;
   }
}

void Pizza::bake()
{
   std::cout << "Bake for 25 minutes at 350" << std::endl;
}

void Pizza::cut()
{
   std::cout << "Cutting the pizza into diagonal slices" << std::endl;
}

void Pizza::box()
{
   std::cout << "Place pizza in official PizzaStore box" << std::endl;
}

Pizza* PizzaStore::orderPizza(std::string t)
{
    Pizza* r = createPizza(t);

    r->prepare();
    r->bake();
    r->box();
    r->cut();

    return r;
}

Pizza* NYStylePizzaStore::createPizza(std::string t)
{
    if (t == "cheese")
    {
        return new NYStyleCheesePizza();
    }
    else if (t == "veggie")
    {
        return new NYStyleVeggiePizza();
    }
    else if (t == "clam")
    {
        return new NYStyleClamPizza();
    }
    else if (t == "pepperoni")
    {
        return new NYStylePepperoniPizza();
    }
    else
    {
        return NULL;
    }
}

Pizza* ChicagoStylePizzaStore::createPizza(std::string t)
{
    if (t == "cheese")
    {
        return new ChicagoStyleCheesePizza();
    }
    else if (t == "veggie")
    {
        return new ChicagoStyleVeggiePizza();
    }
    else if (t == "clam")
    {
        return new ChicagoStyleClamPizza();
    }
    else if (t == "pepperoni")
    {
        return new ChicagoStylePepperoniPizza();
    }
    else
    {
        return NULL;
    }
}

NYStyleCheesePizza::NYStyleCheesePizza()
{
    this->m_name = "NY Style Sauce and Cheese Pizza";
	this->m_dough = "Thin Crust Dough";
	this->m_sauce = "Marinara Sauce";

    this->m_toppings.push_back("Grated Reggiano Chees");
}

NYStyleVeggiePizza::NYStyleVeggiePizza()
{
    this->m_name = "NY Style Veggie Pizza";
	this->m_dough = "Thin Crust Dough";
	this->m_sauce = "Marinara Sauce";

	this->m_toppings.push_back("Grated Reggiano Cheese");
	this->m_toppings.push_back("Garlic");
	this->m_toppings.push_back("Onion");
	this->m_toppings.push_back("Mushrooms");
	this->m_toppings.push_back("Red Pepper");
}

NYStyleClamPizza::NYStyleClamPizza()
{
    this->m_name = "NY Style Clam Pizza";
	this->m_dough = "Thin Crust Dough";
	this->m_sauce = "Marinara Sauce";

	this->m_toppings.push_back("Grated Reggiano Cheese");
	this->m_toppings.push_back("Fresh Clams from Long Island Sound");
}

NYStylePepperoniPizza::NYStylePepperoniPizza()
{
    this->m_name = "NY Style Pepperoni Pizza";
	this->m_dough = "Thin Crust Dough";
	this->m_sauce = "Marinara Sauce";

	this->m_toppings.push_back("Grated Reggiano Cheese");
	this->m_toppings.push_back("Sliced Pepperoni");
	this->m_toppings.push_back("Garlic");
	this->m_toppings.push_back("Onion");
	this->m_toppings.push_back("Mushrooms");
	this->m_toppings.push_back("Red Pepper");
}

ChicagoStyleCheesePizza::ChicagoStyleCheesePizza()
{
    this->m_name = "Chicago Style Deep Dish Cheese Pizza";
	this->m_dough = "Extra Thick Crust Dough";
	this->m_sauce = "Plum Tomato Sauce";

	this->m_toppings.push_back("Shredded Mozzarella Cheese");
}

ChicagoStylePepperoniPizza::ChicagoStylePepperoniPizza()
{
    this->m_name = "Chicago Style Pepperoni Pizza";
	this->m_dough = "Extra Thick Crust Dough";
	this->m_sauce = "Plum Tomato Sauce";

	this->m_toppings.push_back("Shredded Mozzarella Cheese");
	this->m_toppings.push_back("Black Olives");
	this->m_toppings.push_back("Spinach");
	this->m_toppings.push_back("Eggplant");
	this->m_toppings.push_back("Sliced Pepperoni");
}

ChicagoStyleClamPizza::ChicagoStyleClamPizza()
{
    this->m_name = "Chicago Style Clam Pizza";
	this->m_dough = "Extra Thick Crust Dough";
	this->m_sauce = "Plum Tomato Sauce";

	this->m_toppings.push_back("Shredded Mozzarella Cheese");
	this->m_toppings.push_back("Frozen Clams from Chesapeake Bay");
}

ChicagoStyleVeggiePizza::ChicagoStyleVeggiePizza()
{
    this->m_name = "Chicago Deep Dish Veggie Pizza";
	this->m_dough = "Extra Thick Crust Dough";
	this->m_sauce = "Plum Tomato Sauce";

	this->m_toppings.push_back("Shredded Mozzarella Cheese");
	this->m_toppings.push_back("Black Olives");
	this->m_toppings.push_back("Spinach");
	this->m_toppings.push_back("Eggplant");
}
